home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_04 / file.h < prev    next >
C/C++ Source or Header  |  1994-03-20  |  2KB  |  43 lines

  1. /*
  2.  * DDS MICRO-C MS-DOS File system definitions
  3.  *
  4.  * Copyright 1989-1994 Dave Dunfield
  5.  * All rights reserved.
  6.  */
  7.  
  8. #define    PATH_SIZE    65        /* Max. size of pathname (64 + Z) */
  9.  
  10. /* File attribute bits in directory entry */
  11. #define    READONLY    0x01    /* File cannot be written */
  12. #define    HIDDEN        0x02    /* File skipped in normal searches */
  13. #define    SYSTEM        0x04    /* File is considered part of system */
  14. #define    VOLUME        0x08    /* Directory entry is volume label */
  15. #define DIRECTORY    0x10    /* File is a directory */
  16. #define    ARCHIVE        0x20    /* File has been modified */
  17.  
  18. /* Attribute bits in the file control block */
  19. #define    F_READ        0x01    /* File is opened for READ */
  20. #define F_WRITE        0x02    /* File is opened for WRITE */
  21. #define    F_APPEND    0x04    /* Append to file opened for WRITE */
  22. #define    F_BINARY    0x10    /* Inhibit TEXT translations */
  23. #define    F_VERB        0x40    /* Issue error message if failure */
  24. #define    F_QUIT        0x80    /* Terminate execution if failure */
  25.  
  26. /* Low level "standard" I/O streams */
  27. #define    HANDLE        int        /* Type for DOS file handles */
  28. #define    L_stdin        0        /* Low Level standard INPUT */
  29. #define    L_stdout    1        /* Low Level standard OUTPUT */
  30. #define    L_stderr    2        /* Low Level standard ERROR */
  31.  
  32. /* Structure used for buffered file I/O */
  33. struct FILE_structure {
  34.     char FILE_options;        /* Open options */
  35.     int  FILE_handle;        /* DOS file handle */
  36.     int  FILE_iob_size;        /* Size of FILE_buffer */
  37.     int  FILE_io_ptr;        /* Access pointer into buffer */
  38.     int  FILE_io_top;        /* Amount of buffer used */
  39.     char FILE_buffer[]; };    /* I/O data buffer */
  40.  
  41. extern register lprintf();    /* Low level 'printf' */
  42. extern unsigned IOB_size;    /* Default I/O buffer size */
  43.